//
//  ChannelViewController.m
//  42centerTwo
//
//  Created by dragon on 15/10/30.
//  Copyright © 2015年 dragon. All rights reserved.
//

#import "ChannelViewController.h"

@interface ChannelViewController ()
@property UIButton * button;

@property (weak, nonatomic) IBOutlet UICollectionView *cellectionCellOne;

@end

@implementation ChannelViewController

-(void)buttonAction {
    [_button setImage:[UIImage imageNamed:@"bun_search_selected.png"] forState:UIControlStateHighlighted];
    _searchViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;//跳换界面动画
    [self presentViewController:_searchViewController animated:YES completion:nil]; //跳转界面到搜索界面
    
    
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
    //storyID绑定
    _searchViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"searchViewController"];
    
    //按钮的初始化
    _button = [[UIButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width-self.view.frame.size.width/7, self.view.frame.size.height/24, 46, 40)];
    [_button setImage:[UIImage imageNamed:@"bnt_search_normal.png"] forState:UIControlStateNormal];  //普通状态
    [_button addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
    
    
    _cellectionCellOne.backgroundColor = [UIColor redColor];
    
    //添加到view里
    [self.view addSubview:_button];
    
    
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}




/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
